Skip to content

Fix passing of non-ASCII characters as command-line arguments #127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

lassoan
Copy link
Member

@lassoan lassoan commented Jul 29, 2022

@lassoan lassoan requested a review from jcfr July 29, 2022 22:32
@jcfr
Copy link
Member

jcfr commented Jul 30, 2022

Overall looks great 👍

It the use of QLatin1String instead of QString::fromLatin1 for stylistic reason ?

@lassoan
Copy link
Member Author

lassoan commented Jul 30, 2022

It the use of QLatin1String instead of QString::fromLatin1 for stylistic reason ?

Yes, I just chose QLatin1String because it indicates that it is simply a constant definition and it is not a conversion.

I could not test it (just the compilation), so it would be great if you could test it on Linux as described here.

@jcfr
Copy link
Member

jcfr commented Jul 31, 2022

Thanks for the detailed explanation. I will test tomorrow and then move forward with creating a new release.

@achataigner
Copy link

Would it be possible to merge this branch ?
It would simplify my work which uses slicer python interpreter: https://discourse.slicer.org/t/python-interpreter-arguments-containing-special-characters/33466

@achataigner
Copy link

achataigner commented Jan 10, 2024

Any feedback ? @jcfr

@lassoan
Copy link
Member Author

lassoan commented Apr 7, 2024

@jcfr jcfr force-pushed the fix-utf8-args branch from 872e8df to 1aa735b Compare July 2, 2024 14:04
@lassoan
Copy link
Member Author

lassoan commented Mar 7, 2025

I've added a fix that also fixes passing special characters in command-line arguments and fixes the issue of not being able to launch Slicer in a path that contains special character (Slicer/Slicer#8229).

@hjmjohnson
Copy link
Contributor

@lassoan It looks like the mac build timed out. Perhaps this can be tested offline to ensure that the changes recommended are ready for inclusion.

jamesobutler and others added 5 commits July 15, 2025 18:17
Runner "macos-12" was removed on 2024.12.03
See https://github.blog/changelog/2024-08-19-notice-of-upcoming-deprecations-and-breaking-changes-in-github-actions-runners/

> We are beginning the deprecation process for the macOS 12 runner image, which allows us to balance our fleet capacity ahead of our upcoming macOS 15 launch. This image will be fully retired by the December 3rd, 2024.
…Windows

Application path and command-line arguments can now contain special characters.

Note: console launcher on Windows still has not been fixed. wmain would need to be used instead of main and wide characters should be converted to utf8.
@jamesobutler
Copy link
Contributor

Various CI fixes are needed here. I pushed updates that resolved the testing on macOS as seen by the successful macos-13 status check. The "macos-12" status check needs to no longer be a required status check as it will no longer get run as macos-12 github runner was removed at the end of 2024.

@hjmjohnson
Copy link
Contributor

FYI: ```
cmake : CMake Error at CMakeLists.txt:21 (cmake_minimum_required):
At line:3 char:1

  • cmake `
  •   + CategoryInfo          : NotSpecified: (CMake Error at ...imum_required)::String) [], RemoteException
      + FullyQualifiedErrorId : NativeCommandError
    
    CMake 3.16.3 or higher is required.  You are running version 3.16.2
    

1.  The quickest would be to modify the change for minimum cmake version ```cf2bf431 (Hans Johnson                  2025-06-19``` to cmake_minimum_required(VERSION 3.16.2), 
2. OR --  or move the CI forward to VS2019.  (might be a lot of work to get a QT5 version for VS2019
3. OR -- install cmake > 3.16 manually in the VS2017 appveyor image
```yaml
init:
  - ps: |
      $cmakeVersion = "3.27.9"
      $cmakeUrl = "https://github.com/Kitware/CMake/releases/download/v$cmakeVersion/cmake-$cmakeVersion-windows-x86_64.zip"
      Invoke-WebRequest $cmakeUrl -OutFile "cmake.zip"
      Expand-Archive cmake.zip -DestinationPath "$env:USERPROFILE\cmake"
      $cmakeBin = "$env:USERPROFILE\cmake\cmake-$cmakeVersion-windows-x86_64\bin"
      $env:PATH = "$cmakeBin;$env:PATH"
      [System.Environment]::SetEnvironmentVariable("PATH", $env:PATH, "Process")
      cmake --version
     ```
     
Personally, I'm most in favor of option 3 then option 1, and least favorite is option 2.  

@hjmjohnson
Copy link
Contributor

@jamesobutler I made some naiave attempts to fix CI, but it will like require someone with passwords to re-create a new docker image.

I've isolated the CI failures in : #136

Perhaps we could decouple the "non-ASCII characters" fixes from the "CI failures"

@hjmjohnson
Copy link
Contributor

There seems to be a dependence on https://github.com/jcfr/qt-static-build. Perhaps that project should be moved to commontk or Slicer organizations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants